package com.tmt.im.service.interfaces;

import com.tmt.im.service.controller.vo.*;
import com.tmt.springboot.chain._DynamicInterface;
import com.tmt.springboot.common.restful.IExecuteResult;

import java.security.Principal;
import java.util.List;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/8/30 15:14
 * @Version 1.0
 **/
@_DynamicInterface
public interface ISessionMemberManager {


    /**
     * 获取当前用户加入的所有聊天群组列表
     *
     * @param creatorId
     * @param error
     * @return
     */
    List<ChatSessionDetailVo> getAllSession(Long creatorId, StringBuilder error);

    /**
     * 拉人加入聊天群组
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    JoinSessionResponse joinSession(Long currentUserId, JoinSessionRequest request, Principal principal, StringBuilder error);

    /**
     * 分页获取待审入群邀请列表
     * @param currentUserId
     * @param tid
     * @param pageIndex
     * @param pageSize
     * @param principal
     * @param error
     * @return
     */
    WaitingCheckInvitationResponse listInvitation(Long currentUserId, Long tid, int pageIndex, int pageSize,
                                                  Principal principal, StringBuilder error);
    /**
     * 群主或管理员审核入群邀请
     *
     * @param currentUserId
     * @param reply
     * @param principal
     * @param error
     * @return
     */
    boolean reviewInvitation(Long currentUserId, JoiningSessionReply reply, Principal principal, StringBuilder error);

    /**
     * 回复入群邀请
     *
     * @param currentUserId
     * @param reply
     * @param principal
     * @param error
     * @return
     */
    boolean replyInvitation(Long currentUserId, JoiningSessionReply reply, Principal principal, StringBuilder error);

    /**
     * 踢出群组成员
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    KickOutSessionResponse kickOutSession(Long currentUserId, KickOutSessionRequest request, Principal principal, StringBuilder error);

    /**
     * 主动退群
     *
     * @param currentUserId
     * @param tid
     * @param principal
     * @param error
     * @return
     */
    boolean leaveSession(Long currentUserId, Long tid, Principal principal, StringBuilder error);

    /**
     * 更新成员设置
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    IExecuteResult<Boolean> updateForbidRedPackage(Long currentUserId, UpdateForbidRedPackageRequest request, Principal principal, StringBuilder error);

    /**
     * 更新群成员在群中的昵称
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    IExecuteResult<Boolean> updateMemberNick(Long currentUserId, UpdateMemberNickRequest request, Principal principal, StringBuilder error);

    /**
     * 群成员禁言
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    IExecuteResult<ChatBannedResponse> bannedMembers(Long currentUserId, ChatBannedRequest request, Principal principal, StringBuilder error);

    /**
     * 群消息免打扰
     *
     * @param currentUserId
     * @param request
     * @param principal
     * @param error
     * @return
     */
    IExecuteResult<Boolean> noDisturbingMember(Long currentUserId, NoDisturbingRequest request, Principal principal, StringBuilder error);

    /**
     * 分页查询当前用户加入的所有群组列表
     *
     * @param currentUserId
     * @param pageIndex
     * @param pageSize
     * @param principal
     * @param error
     * @return
     */
    @Deprecated
    QueryGroupInfoResponse queryGroupList(Long currentUserId, int pageIndex, int pageSize, Principal principal, StringBuilder error);
}
